package com.itisyue.fun;


import com.itisyue.fun.controller.HelloController;
import com.itisyue.fun.controller.UserController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.ai.tool.method.MethodToolCallbackProvider;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class SpringMainApp implements CommandLineRunner {
    private static final Logger logger = LoggerFactory.getLogger(SpringMainApp.class);

    public static void main(String[] args) {
        SpringApplication.run(SpringMainApp.class, args);
    }


    @Bean
    ToolCallbackProvider toolCallbackProvider(UserController userController, HelloController helloController) {
        return MethodToolCallbackProvider.builder()
                .toolObjects(userController, helloController)
                .build();
    }

    @Override
    public void run(String... args) {
        logger.debug("DEBUG日志测试");
        logger.info("INFO日志测试");
        logger.error("ERROR日志测试");
    }
}